package com.cubicleman.airvj.commands
{
import com.adobe.cairngorm.control.CairngormEvent;
import com.cubicleman.airvj.delegates.MTVDelegate;
import com.cubicleman.airvj.events.LookUpLyricsEvent;
import com.cubicleman.airvj.model.vo.LyricsRequest;
import com.universalmind.cairngorm.commands.Command;

import mx.controls.Alert;

/**
 *  The LookUpLyricsCommand is responsible for fetching lyrics from lyricsfly
 */
public class LookUpLyricsCommand extends Command
{
	
	
	//--------------------------------------------------------------------------
	//
	//  Constructor
	//
	//--------------------------------------------------------------------------
	
	/**
	 *  Constructor.
	 */
	public function LookUpLyricsCommand()
	{
		super();
	}
	
	//--------------------------------------------------------------------------
    //
    //  Methods
    //
    //--------------------------------------------------------------------------

    /**
     *  Executes the SearchVideosCommand
     */
	override public function execute( event:CairngormEvent ) : void 
	{
		super.execute( event )
		var typedEvent:LookUpLyricsEvent = LookUpLyricsEvent( event );
		var del:MTVDelegate = new MTVDelegate( this );
		del.lyricsSearch( typedEvent.lyricsRequest );
	}
	
	/**
	 * @override
	 */
	override public function result( info : Object ):void 
	{
		super.result( info );
	}
	
	/**
	 *  @override
	 */
	override public function fault( info : Object ) : void
	{
		Alert.show('There was a issue with the MTV Service.');
	}
	
	
	
	
}
}